package manageend

import (
	"gitee.com/baal1990/epidemic/api/v1"
	"gitee.com/baal1990/epidemic/middleware"
	"github.com/gin-gonic/gin"
)

// ManageRouter 管理侧接口
func ManageRouter(r *gin.Engine) {
	var epidemicUserApi = v1.ApiGroupApp.EpidemicApiGroup.EpidemicUserApi
	var epidemicInvestigationDetailsApi = v1.ApiGroupApp.EpidemicApiGroup.EpidemicInvestigationDetailsApi
	var epidemicRelatedStaffApi = v1.ApiGroupApp.EpidemicApiGroup.EpidemicRelatedStaffApi
	var epidemicInvestigationFormApi = v1.ApiGroupApp.EpidemicApiGroup.EpidemicInvestigationFormApi
	var epidemicRelatedStaffHistoryApi = v1.ApiGroupApp.EpidemicApiGroup.EpidemicRelatedStaffHistoryApi
	var dataStatisticsApi = v1.ApiGroupApp.EpidemicApiGroup.DataStatisticsApi
	router := r.Group("epidemic")
	router.Use(middleware.Auth(), middleware.IsManager())
	{
		router.GET("/user/find", epidemicUserApi.FindEpidemicUser)                                                                              // 手机号获取用户信息
		router.GET("/user/list", epidemicUserApi.GetEpidemicUserList)                                                                           // 获取EpidemicUser列表
		router.POST("/user/verify", epidemicUserApi.VerifyEpidemicUser)                                                                         // 批量审核
		router.POST("/user/urge", epidemicUserApi.Urge)                                                                                         // 催办
		router.POST("/user/upload", epidemicUserApi.UploadFile)                                                                                 // 上传文件
		router.DELETE("/user/:id", epidemicUserApi.DeleteEpidemicUser)                                                                          // 删除EpidemicRelatedStaff
		router.POST("/user/edit", epidemicUserApi.CreateOrUpdateEpidemicUser)                                                                   // 新建/编辑
		router.GET("/user_list/export", epidemicUserApi.ExportAll)                                                                              // 导出全部用户列表
		router.GET("/investigation_user/export", epidemicRelatedStaffApi.ExportAll)                                                             // 导出全部涉疫人员信息
		router.PUT("/related_staff/edit", epidemicRelatedStaffApi.SaveEpidemicRelatedStaff)                                                     // 更新EpidemicRelatedStaff
		router.PUT("/related_staff/return", epidemicRelatedStaffApi.Return)                                                                     // 返岗
		router.GET("/related_staff/list", epidemicRelatedStaffApi.GetEpidemicRelatedStaffList)                                                  // 获取EpidemicRelatedStaff列表
		router.POST("/related_staff/auto-nofity", epidemicRelatedStaffApi.AutoNotify)                                                           // 开启/关闭自动通知
		router.DELETE("/related_staff/:id", epidemicRelatedStaffApi.DeleteEpidemicRelatedStaff)                                                 // 删除EpidemicRelatedStaff
		router.DELETE("/investigation/deleteEpidemicInvestigationForm", epidemicInvestigationFormApi.DeleteEpidemicInvestigationForm)           // 删除EpidemicInvestigationForm
		router.DELETE("/investigation/deleteEpidemicInvestigationFormByIds", epidemicInvestigationFormApi.DeleteEpidemicInvestigationFormByIds) // 批量删除EpidemicInvestigationForm
		router.GET("/investigation/findEpidemicInvestigationForm", epidemicInvestigationFormApi.FindEpidemicInvestigationForm)                  // 根据ID获取EpidemicInvestigationForm
		router.GET("/investigation/list", epidemicInvestigationFormApi.GetEpidemicInvestigationFormList)                                        // 列表
		router.POST("/investigation/status", epidemicInvestigationFormApi.UpdateEpidemicInvestigationForm)                                      // 更新状态
		router.POST("/investigation/edit", epidemicInvestigationFormApi.CreateOrUpdate)                                                         // 新建/更新
		router.DELETE("/investigation/:id", epidemicInvestigationFormApi.DeleteEpidemicInvestigationForm)                                       // 删除EpidemicRelatedStaff
		router.GET("/investigation_details/list", epidemicInvestigationDetailsApi.GetEpidemicInvestigationDetailsList)                          // 获取EpidemicInvestigationDetails列表
		router.GET("/investigation_details/export", epidemicInvestigationDetailsApi.ExportAll)                                                  // 获取EpidemicInvestigationDetails列表
		router.GET("/related_staff_history/list", epidemicRelatedStaffHistoryApi.List)                                                          // 居家人员明细列表
		router.GET("/related_staff_history/export", epidemicRelatedStaffHistoryApi.Export)                                                      // 居家人员明细导出
		router.POST("/related_staff_history/reduction", epidemicRelatedStaffHistoryApi.Reduction)                                               // 居家人员明细数据恢复
		router.GET("/data-statistics/:id", dataStatisticsApi.GetDataStatistics)                                                                 // 数据统计
	}
}
